package main

import (
	"fmt"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
	"two_exam/config"
	"two_exam/internal/model/dao"
)

func main() {

	var err error
	dsn := fmt.Sprintf("root:mysql_nNP5wS@tcp(117.27.231.169:3306)/2208a_ks?charset=utf8&parseTime=true")
	config.DB, err = gorm.Open(mysql.Open(dsn))
	if err != nil {
		panic(err)
	}
	err = config.DB.AutoMigrate(&dao.UserChat{})
	if err != nil {
		panic(err)
	}
	fmt.Println("迁移成功")
}
